<!--{template header}--><!--contain start-->
<div class="wrapper">
<div class="body_container">
 <div class="container_24">
  <!--{template user/user_nav}-->
<!--main start-->
 <section class="clearfix section">
  <!--{template user/user_side}-->
   <div class="show_panel container_24 po_re">
    <div class="prefix_3 grid_21">
      <div class="panel clearfix box">
      <!--main content-->
      <div class="">
       <!--header内容头部 start-->
         <header class="clearfix box_header">
          <h2 class="grid_4 alpha omega box_title t_c">{$_lang['account_recharge']}</h2>
		   <div class="grid_17 alpha omega">
	            <nav class="box_nav">
	                <ul> 
	                    <li {if $show=='online'}class="selectedLava"{/if}>
	                        <a href="index.php?do=user&view=finance&op=recharge&show=online#userCenter">{$_lang['online_pay']}</a>
	                    </li>
	                    <li {if $show=='offline'}class="selectedLava"{/if}>
	                        <a href="index.php?do=user&view=finance&op=recharge&show=offline#userCenter">{$_lang['offline_pay']}</a>
	                    </li>
	                </ul>
	            </nav>
	        </div>
           <div class="clear"></div>
         </header>
     	   <!--header内容头部 end-->
		 
		   <!--detail内容 start-->
		 <article class="box_detail">
		  {if $show != 'offline'}	
		  <!--messages消息 start-->
		  
		   <div class="msg msg_tips block clearfix ml_10 mr_10">		   	
		     <i></i>
		         {$_lang['recharge_min_money']}:{c:$pay_arr['recharge_min']['v']}{$_lang['zh_jh']} {$_lang['recharge_notice']}
		   </div>
		  <!--messages消息 end-->
		   <div class="prefix_1 suffix_1 clearfix">
		      <div class="pad10 ">
		      <div class=" ">
		       <div class="clearfix box font14">
		       <form action="" name="pay" id="pay" method="post">
		         <div class="rowElem clearfix">
		          <label>{$_lang['input_recharge_money']}{$_lang['zh_mh']}</label>
		            <input class="txt_input" type="text" name="recharge" id="recharge" value="{$cash}" size="30" limit="required:true;type:float;between:$pay_arr['recharge_min']['v']-100000" msg="{$_lang['recharge_money_notice']}{$pay_arr['recharge_min']['v']}{$_lang['yuan']}" title="{$_lang['recharge_money_notice']}{$pay_arr['recharge_min']['v']}{$_lang['yuan']}" msgArea="txt_cash_in_msg"/>
					<span id="txt_cash_in_msg"></span>
		         </div>
		  
		        </div>
				
				<!--start 线上支付方式-->
		           <div class="online">
		              <div class=" account1 clearfix">
		                
		                  
		                    <!--{eval $k=0;}-->
							{loop $payment_list $pay}
		                       {if $pay['pay_status']}<!--{eval $k++;}-->
		                          <div class="fl_l pay_way" style="width:140px; *width:100px; _width:100px;">
		                              <label class="fl_l"> 
									  <input class="fl_l mt_10" type="radio" name="online" value="{$pay['payment']}" {if $k=='1'}checked="checked"{/if}/>
									  <img class="ov_hide fl_l" style="width:100px;"  src="payment/{$pay['payment']}/{$pay['payment']}.gif" align="absmiddle" >
									  </label>
		                          </div>
							   {/if} 
		                    {/loop}
							{if $k==0}
							   <div>{$_lang['online_pay']}{$_lang['account_close']}{$_lang['contact_admin']}</div>
							 {/if} 
		               
		               </div>
					<div class="clearfix form_box">
						<table id="tbl_ten" cellspacing="0" border="0" cellpadding="0" width="100%" height="120" >
							<caption class="bf7 pad5"><img src="resource/img/bank/logo.gif"/>{$_lang['provide_payment_service']}</caption>
							<!--{eval $i=0;}-->
							<tr>
							{loop $ten_bank_type_arr $k $v}
							<!--{eval $i++;}-->
								<td class="pl_20 pt_10 pb_10"><input class="fl_l" type="radio" name="bank_type" {if $i==1} checked="checked" {/if} value="{$k}" id="{$k}">
								<label class="pay_way" for="{$k}" style="cursor:pointer; float:left; *width:100px;"><img src="resource/img/bank/{$v}.gif"/></label>
								</td>
								{if $i%4==0}
								</tr>
								<tr>
								<!--{eval continue;}-->
								{/if}
							{/loop}
							
								<tr>
						</table>
					</div>
		            <div class="rowElem clearfix t_c">
		               <input type="hidden" name="sbt_pay" value="1">
		               <button type="submit" name="sbt_button" value={$_lang['pay']} style="width:100px" onclick=" return user_pay();">{$_lang['pay']}</button>
		            </div>
					
		            </div>
					</form>
				<!--end 线上支付方式-->
				
		       </div>
		     </div>
		    </div>
			
		    <div class="clear"></div>
			{elseif $show=='offline'}
			  <div class="msg msg_tips block clearfix ml_10 mr_10">		   	
		     					<i></i>
		                   {$_K['website_name']}{$_lang['remit_notice']} 
		       </div>
		      <form action="index.php?do=$do&view=$view&op=$op&step=step2&pay_type=offline_charge" name="offpay" id="offpay" method="post">
				<input type="hidden" name="formhash" id="formhash" value="{FORMHASH}">
				<input type="hidden" name="step" value="step2">		
				<input type="hidden" name="pay_type" value="offline_charge">
				<input type="hidden" name="pay_account" id="pay_account">				
			   	<div class="suffix_1 prefix_1 pt_10">
			   		
					<div class="rowElem clearfix fon14">
			          <label>{$_lang['input_recharge_money']}{$_lang['zh_mh']}</label>
			            <input class="txt_input" type="text" name="recharge" id="recharge" value="{$cash}" size="30" limit="required:true;type:float;between:$pay_arr['recharge_min']['v']-100000" msg="{$_lang['recharge_money_notice']}{$pay_arr['recharge_min']['v']}{$_lang['yuan']}" title="{$_lang['recharge_money_notice']}{$pay_arr['recharge_min']['v']}{$_lang['yuan']}" msgArea="txt_cash_in_msg"/>
						<span id="txt_cash_in_msg"></span>
			         </div>
				 
					<!--start 线下支付方式-->
		            <div class=" offline " id="div_cont_2">
		               
		               <div class=" account1">
		                  	<div class="form_box">
		                      <h3 class="bf7 pad10">{$_lang['optional_account']}</h3>
		                     
							  {if is_array($offline_pay_list)}
							  <table id="" cellspacing="0" border="0" cellpadding="0" width="100%" >
							  	<tr>
							  		<!--{eval $i=0;}-->
								  {loop $offline_pay_list $k $v}
								  	{if $v['pay_status']} 
			                           <!--{eval $i++;}-->
			                              <td class="pl_20 pt_10 pb_10">
			                                 <input type="radio" name="offline" id="{$v['payment']}"  value="{$v['pay_name']}" {if $k=='icbc'}checked{/if}/>
											 <label for="{$v['payment']}">
											 <img src="resource/img/system/kppw_2.0_{$v['payment']}.png" height="34">
											 </label>
			                              
			                                 <ul class="prefix_1">
			                                   <li>{$_lang['pay_name']}{$_lang['zh_mh']}{$v['pay_name']} </li>
			                                   <li> {$_lang['choose_pay_account']}{$_lang['zh_mh']}{$v['pay_account']}</li>
			                                   <li>{$_lang['pay_user']}{$_lang['zh_mh']}{$v['pay_user']}</li>
			                                  
			                                 </ul>
			                               </td>
										   {if $i%3==0}
											</tr>
											<tr>
											<!--{eval continue;}-->
											{/if}
			                            
			                          {/if} 
			                       {/loop}
								   
								 </table>
								   
								   <div class="clear"></div>
								 </div>
				               		<div class="mt_10 mb_10 font12 account1 clearfix">
				                  		
						                  	
						                   
						                   		<span class="fl_l">{$_lang['recharge_info']}{$_lang['zh_mh']}</span>
												<div class="fl_l">
												<textarea name="pay_info" id="pay_info" style="width:400px;height:80px"></textarea>
												
													<div>{$_lang['audit_notice']}</div>
												</div>
											 
									 
				                   </div>
								   
						            <div class="rowElem clearfix t_c">
						               <input type="hidden" name="sbt_pay" value="1">
						               <button type="submit" name="sbt_button" onclick="return off_pay();" value={$_lang['pay']} style="width:100px" >{$_lang['pay']}</button>
						            </div>
							 	{else}  
							   		<div>{$_lang['offline_pay']}{$_lang['account_close']}{$_lang['contact_admin']}</div>
							   {/if}
		                     
		                   </div>
						   
					      
						   
						 
		                 </div>
					<!--end 线下支付方式-->
		         
		        </form>
		       </div>
		       <div class="clear"></div>
		      
		    {/if}    
		      
		    
		  </article>
		  <!--detail内容 end-->
 
 	</div>
	  <!--main content end -->
	  <div class="clear"></div>
	  </div>
	</div>
    <!--main end-->
	</div>
 </section>
</div>
</div>
<!--contain end-->
<script type="text/javascript">
	In('form');
 $(function(){
      var uid = parseInt("{$uid}") + 0;
	  
      $("button[name='sbt_button']").click(function(){
        
           if ($("#recharge").val() < $pay_arr['recharge_min']['v']) {
                 showDialog("{$_lang['recharge_money_not_less']}"+"{$pay_arr['recharge_min']['v']}"+"{$_lang['yuan']}"+"{$_lang['zh_th']}", 'alert', "{$_lang['error_tips']}");
                 document.getElementById("recharge").focus();
             } else if ($("#recharge").val() < 0) {
                     document.getElementById("recharge").focus();
                     showDialog("{$_lang['money_input_error']}", 'alert', "{$_lang['error_tip']}");
             }
	      
        })
	//如果是财富通，就隐藏网银列表	
	$(":radio[name='online']").click(function(){
		if($(this).val()=='tenpay'){
			$("#tbl_ten").parent().show();
		}else{
			$("#tbl_ten").parent().hide();
		}
		
	})	
  })
  function check_recharge(){
    	 var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/ 
  		if ($("#recharge").val() < $pay_arr['recharge_min']['v']) {
                 showDialog("{$_lang['recharge_money_not_less']}"+"{$pay_arr['recharge_min']['v']}"+"{$_lang['yuan']}"+"{$_lang['zh_th']}", 'alert', "{$_lang['error_tips']}");
                 document.getElementById("recharge").focus();
				 return false;
         } else if ($("#recharge").val() < 0) {
                     document.getElementById("recharge").focus();
                     showDialog("{$_lang['money_input_error']}", 'alert', "{$_lang['error_tip']}");
					 return false;
        }
         else if (!re.test($("#recharge").val())) 
    	 { 
             document.getElementById("recharge").focus();
             showDialog("{$_lang['money_input_error']}", 'alert', "{$_lang['error_tip']}");
			 return false;
    	 }
		return true;
  }
             
function user_pay(){
	  if(check_recharge()==false){
	  	return false;
	  }
	  
      //支付金额
      var cash = parseFloat($("#recharge").val()) + 0;
	  //支付方式--财富通，支付宝
	  var pay_mode = $(":radio[name='online']:checked").val();
	  //财富通就要添加银行类型
	  var bank_type = $(":radio[name='bank_type']:checked").val(); 
	  //弹出付款窗口
	  pay(pay_mode,cash,bank_type);
	  return false;

}
function pay(pay_mode,cash,bank_type){

	var url = '$ac_url&step=step2&pay_type=online_charge&ajax=confirm&cash=' + cash + '&pay_mode=' + pay_mode;
	if(bank_type){
		url += "&bank_type="+bank_type;	
	}
	
    showWindow("pay",url,'get',0,{cover:1});return false;
} 

function off_pay(){
	if(!checkForm(document.getElementById("offpay"),false)){
		return false;
	}
	var pay_account = $(":radio[name='offline']:checked").val();
	var acc = $(":radio[name='offline']:checked").attr('id');
	$("#pay_account").val(acc);	
	showDialog("{$_lang['you_choose_us']}【"+pay_account+"】{$_lang['offline_recharge_confirm_submit']}", "confirm","{$_lang['recharge_tip']}",'formSub("offpay","form",false);');
	return false;
}
  </script>
<!--{template user/user_footer}-->  
<!--{template footer}-->
